export const reduceSuccess = (init, {request, success}) => (state = init, action) => {
    if(action.type === request){
        return init;
    }
    return action.type === success ? _.get(action.response, 'data', state) : state;
};

export const returnSuccess = ({request, success}) => (state = {success: false}, action) => {
    if(action.type === request){
        return {success: false};
    }
    return action.type === success ? {success: true} : state;
};
